//
// Copyright (C) 2000 Institut fuer Telematik, Universitaet Karlsruhe
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//


package inet.nodes.inet;

import inet.applications.generic.IPTrafficGenerator;
import inet.applications.generic.IPTrafGen;
import inet.base.NotificationBoard;
import inet.linklayer.ppp.PPPInterface;
import inet.networklayer.common.InterfaceTable;
import inet.networklayer.ipv4.RoutingTable;

//
// Definition of an IP node with a transport generator that connects
// to IP directly, without TCP or UDP.
//
module BurstHost
{
    parameters:
        @node();
        string trafGenType;
        bool IPForward = default(false);
        string routingFile = default("");
        @display("i=device/pc3");
    gates:
        inout pppg[];
    submodules:
        notificationBoard: NotificationBoard {
            parameters:
                @display("p=83,52");
        }
        interfaceTable: InterfaceTable {
            parameters:
                @display("p=83,136");
        }
        routingTable: RoutingTable {
            parameters:
                IPForward = IPForward;
                routerId = "";
                routingFile = routingFile;
                @display("p=83,221");
        }
        networkLayer: NetworkLayer {
            parameters:
                @display("p=207,136;q=queue");
            gates:
                ifIn[1];
                ifOut[1];
        }
        ppp[1]: PPPInterface {
            parameters:
                @display("p=207,221,row,90;q=txQueue");
        }
        trafGen: <trafGenType> like IPTrafficGenerator {
            @display("p=207,52");
        }
        routingTable1: RoutingTable {
            parameters:
                IPForward = IPForward;
                routerId = "";
                routingFile = routingFile;
                @display("p=83,305");
        }
    connections allowunconnected:
        // connections to network outside
        for i=0..0 {
            pppg[i] <--> ppp[i].phys;
            ppp[i].netwOut --> networkLayer.ifIn[i];
            ppp[i].netwIn <-- networkLayer.ifOut[i];
        }

        // transport connections
        networkLayer.udpIn <-- trafGen.ipOut;
        networkLayer.udpOut --> trafGen.ipIn;
}
